/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui2cf35cui.impl;

import java.util.Collection;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.util.EObjectResolvingEList;

import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui2cf35cui.Adaptedaui2cf35cuiPackage;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui2cf35cui.Command;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui2cf35cui.Presentation;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Command</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui2cf35cui.impl.CommandImpl#getDestinations <em>Destinations</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public abstract class CommandImpl extends UIElementImpl implements Command {
	/**
	 * The cached value of the '{@link #getDestinations() <em>Destinations</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDestinations()
	 * @generated
	 * @ordered
	 */
	protected EList<Presentation> destinations;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected CommandImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return Adaptedaui2cf35cuiPackage.Literals.COMMAND;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Presentation> getDestinations() {
		if (destinations == null) {
			destinations = new EObjectResolvingEList<Presentation>(Presentation.class, this, Adaptedaui2cf35cuiPackage.COMMAND__DESTINATIONS);
		}
		return destinations;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case Adaptedaui2cf35cuiPackage.COMMAND__DESTINATIONS:
				return getDestinations();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case Adaptedaui2cf35cuiPackage.COMMAND__DESTINATIONS:
				getDestinations().clear();
				getDestinations().addAll((Collection<? extends Presentation>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case Adaptedaui2cf35cuiPackage.COMMAND__DESTINATIONS:
				getDestinations().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case Adaptedaui2cf35cuiPackage.COMMAND__DESTINATIONS:
				return destinations != null && !destinations.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //CommandImpl
